#include "Setting_About.h"
#include <QApplication>

namespace UserManagementSystem {
Setting_About::Setting_About(QWidget *parent)
    : QWidget{parent}
{
    qDebug()<<__FUNCTION__;

    m_mainLayout=new QVBoxLayout(this);

    m_subLayout1=new QHBoxLayout();

    m_subLayout2=new QVBoxLayout();
    m_rightArrowBtn=new QPushButton();

    m_label_1.setText(tr("访问 Aidite Cloud"));
    m_label_2.setText(tr("查看病例、订单及伙伴关系"));
    m_label_3.setText(tr("关于软件"));
    m_label_4.setText(tr("当前版本：1.3.8"));
    m_label_5.setText(tr("目前版本已是最新，无需更新"));

    InitDefaultLayout();
}

void Setting_About::InitDefaultLayout()
{
    QVBoxLayout* m_visitlayout=new QVBoxLayout();

    m_visitlayout->addWidget(&m_label_1);
    m_visitlayout->addWidget(&m_label_2);

    m_subLayout1->addLayout(m_visitlayout);
    m_subLayout1->addStretch(1);
    m_subLayout1->addWidget(m_rightArrowBtn);

    m_mainLayout->addLayout(m_subLayout1);
    m_mainLayout->addSpacing(15);

    m_mainLayout->addWidget(&m_label_3);
    m_mainLayout->addSpacing(10);
    m_mainLayout->addWidget(&m_label_4);
    m_mainLayout->addSpacing(10);
    m_mainLayout->addWidget(&m_label_5);
    m_mainLayout->setContentsMargins(10,10,10,10);
    m_mainLayout->addStretch(1);
    InitDefaultStyle();
}

void Setting_About::InitDefaultStyle()
{
    m_label_1.setStyleSheet("font-size:9pt; font-weight: bold;");
    m_label_3.setStyleSheet("font-size:9pt; font-weight: bold;");
    m_label_2.setStyleSheet("font-size:9pt;color: gray;");

    m_label_4.setStyleSheet("font-size:9pt;color: gray;");
    m_label_5.setStyleSheet("font-size:9pt;color: black;");

    QString right_arrow_path=QApplication::applicationDirPath()+"/res/PatientManager/right_arrow.png";

    m_rightArrowBtn->setFixedSize(30,30);
    m_rightArrowBtn->setStyleSheet("border:none;");
    m_rightArrowBtn->setIcon(QIcon(right_arrow_path));

}

}
